#include <iostream>
#include <conio.h>
#include <string.h>


#include "classmenu.h"
#include <windows.h>
#include "player.h"
#include "Lahan.h"
#include "boolean.h"
#include "classinventory.h"
#include "Times.h"
using namespace std;

// Konstruktor
Player::Player(char *nama)
{
    strcpy(Player::nama, nama);
    PosPlayer.x = 0;
    PosPlayer.y = 0;
    FacingTo = '>';
}

Player::Player(const Player& P)
{
    strcpy(Player::nama, P.nama);
    PosPlayer.x = P.PosPlayer.x;
    PosPlayer.y = P.PosPlayer.y;
    FacingTo = P.FacingTo;
}

Player& Player::operator= (const Player& P)
{
    strcpy(Player::nama, P.nama);
    PosPlayer.x = P.PosPlayer.x;
    PosPlayer.y = P.PosPlayer.y;
    FacingTo = P.FacingTo;
    return (*this);
}

// Destruktor
Player::~Player()
{

}

char* Player::GetName()
{
    return nama;
}

// Fungsi Lain
void Player::Move(char FaceTo)
{
    int cond1 = L.getStatus(P.GetPosition().x, P.GetPosition().y - 1);  // untuk aksi ke atas
    int cond2 = L.getStatus(P.GetPosition().x, P.GetPosition().y + 1);  // untuk aksi ke bawah
    int cond3 = L.getStatus(P.GetPosition().x + 1, P.GetPosition().y);  // untuk aksi ke kanan
    int cond4 = L.getStatus(P.GetPosition().x - 1, P.GetPosition().y);  // untuk aksi ke kiri

    M.IsSaved = 0;

    switch (FaceTo)
    {
        case '^' :
                if (FacingTo != '^')
                        ChangeDirect('^');
                else
                if ((PosPlayer.y > 0) && ((cond1 != 5) && (cond1 != 6) && (cond1 != 7) && (cond1 != 8)))
                        if ((PosPlayer.x != 8) || (PosPlayer.y != 1))   // berjalan ke arah titik jual
                                SetPosition(PosPlayer.x, PosPlayer.y - 1);
                break;
        case 'v' :
                if (FacingTo != 'v')
                        ChangeDirect('v');
                else
                if ((PosPlayer.y < 8) && ((cond2 != 5) && (cond2 != 6) && (cond2 != 7) && (cond2 != 8)))
                        SetPosition(PosPlayer.x, PosPlayer.y + 1);
                break;
        case '>' :
                if (FacingTo != '>')
                        ChangeDirect('>');
                else
                if ((PosPlayer.x < 8) && ((cond3 != 5) && (cond3 != 6) && (cond3 != 7) && (cond3 != 8)))
                        if ((PosPlayer.x != 7) || (PosPlayer.y != 0))   // berjalan ke arah titik jual
                                SetPosition(PosPlayer.x + 1, PosPlayer.y);
                break;
        case '<' :
                if (FacingTo != '<')
                        ChangeDirect('<');
                else
                if ((PosPlayer.x > 0) && ((cond4 != 5) && (cond4 != 6) && (cond4 != 7) && (cond4 != 8)))
                        SetPosition(PosPlayer.x - 1, PosPlayer.y);
                break;
    }
}

void Player::Teleport(int Place)
{
    Player::Place = Place;
}

void Player::ChangeDirect(char Face)
{
    Player::FacingTo = Face;
}

void Player::Plow()
{
    int cond1 = L.getStatus(P.GetPosition().x, P.GetPosition().y - 1);  // untuk aksi ke atas
    int cond2 = L.getStatus(P.GetPosition().x, P.GetPosition().y + 1);  // untuk aksi ke bawah
    int cond3 = L.getStatus(P.GetPosition().x + 1, P.GetPosition().y);  // untuk aksi ke kanan
    int cond4 = L.getStatus(P.GetPosition().x - 1, P.GetPosition().y);  // untuk aksi ke kiri

    M.IsSaved = 0;

    switch (FacingTo)
    {
        case '^' :
                if (PosPlayer.y > 1)
                {
                    if (cond1 == 1)
                    {
                        L.setStatus(PosPlayer.x, PosPlayer.y - 1, 2);
                    }
                    else if ((cond1 == 3) || (cond1 == 4))
                    {
                        L.deleteTanaman(PosPlayer.x, PosPlayer.y - 1);
                        L.setStatus(PosPlayer.x, PosPlayer.y - 1, 2);
                    }
                    else
                    {
                        cerr << "It's useless..." << endl;
                        Sleep(1000);
                    }
                }
                else
                {
                    cerr << "You can't plow here!" << endl;
                    Sleep(1000);
                }
                break;
        case 'v' :
                if (PosPlayer.y < 7)
                {
                    if (cond2 == 1)
                    {
                        L.setStatus(PosPlayer.x, PosPlayer.y + 1, 2);
                    }
                    else if ((cond2 == 3) || (cond2 == 4))
                    {
                        L.deleteTanaman(PosPlayer.x, PosPlayer.y + 1);
                        L.setStatus(PosPlayer.x, PosPlayer.y + 1, 2);
                    }
                    else
                    {
                        cerr << "It's useless..." << endl;
                        Sleep(1000);
                    }
                }
                else
                {
                    cerr << "You can't plow here!" << endl;
                    Sleep(1000);
                }
                break;
        case '>' :
                if (PosPlayer.x < 7)
                {
                    if (cond3 == 1)
                    {
                        L.setStatus(PosPlayer.x + 1, PosPlayer.y, 2);
                    }
                    else if ((cond3 == 3) || (cond3 == 4))
                    {
                        L.deleteTanaman(PosPlayer.x + 1, PosPlayer.y);
                        L.setStatus(PosPlayer.x + 1, PosPlayer.y, 2);
                    }
                    else
                    {
                        cerr << "It's useless..." << endl;
                        Sleep(1000);
                    }
                }
                else
                {
                    cerr << "You can't plow here!" << endl;
                    Sleep(1000);
                }
                break;
        case '<' :
                if (PosPlayer.x > 1)
                {
                    if (cond4 == 1)
                    {
                        L.setStatus(PosPlayer.x - 1, PosPlayer.y, 2);
                    }
                    else if ((cond4 == 3) || (cond4 == 4))
                    {
                        L.deleteTanaman(PosPlayer.x - 1, PosPlayer.y);
                        L.setStatus(PosPlayer.x - 1, PosPlayer.y, 2);
                    }
                    else
                    {
                        cerr << "It's useless..." << endl;
                        Sleep(1000);
                    }
                }
                else
                {
                    cerr << "You can't plow here!" << endl;
                    Sleep(1000);
                }
                break;
    }
}

void Player::Put(int slot, int jumlah)
{
    int cond1 = L.getStatus(P.GetPosition().x, P.GetPosition().y - 1);  // untuk aksi ke atas
    int cond2 = L.getStatus(P.GetPosition().x, P.GetPosition().y + 1);  // untuk aksi ke bawah
    int cond3 = L.getStatus(P.GetPosition().x + 1, P.GetPosition().y);  // untuk aksi ke kanan
    int cond4 = L.getStatus(P.GetPosition().x - 1, P.GetPosition().y);  // untuk aksi ke kiri

    M.IsSaved = 0;

    switch (FacingTo)
    {
        case '^' :
                if ((PosPlayer.x == 8) && (PosPlayer.y == 1))   // ke arah titik jual
                {
                    if (!I.IsBibit(slot))
                        I.Sell(slot, jumlah);
                    else
                    {
                        cout << "You can't sell seed here!" << endl;
                        Sleep(1000);
                    }
                }
                else
                if ((PosPlayer.y > 0) && (cond1 == 2))          // menanam bibit
                {
                    if (I.IsBibit(slot))
                    {
                        L.setStatus(PosPlayer.x, PosPlayer.y - 1, 3);
                        L.setTanaman(PosPlayer.x, PosPlayer.y - 1, I.GetKodeBarang(slot) + 8);
                        I.DeleteInventory(I.GetKodeBarang(slot), jumlah);
                        int musim = L.getTanaman(PosPlayer.x, PosPlayer.y - 1).GetMusimable();
                        switch (T.GetSeason())
                        {
                            case 0:
                                if ((musim != 0) && (musim != 4) && (musim != 5))
                                    while(L.getTanaman(PosPlayer.x, PosPlayer.y - 1).GetAge() != 0)
                                        L.getTanaman(PosPlayer.x, PosPlayer.y - 1).DecAge();
                                break;
                            case 1:
                                if ((musim != 1) && (musim != 4) && (musim != 5) && (musim != 6))
                                    while(L.getTanaman(PosPlayer.x, PosPlayer.y - 1).GetAge() != 0)
                                        L.getTanaman(PosPlayer.x, PosPlayer.y - 1).DecAge();
                                break;
                            case 2:
                                if ((musim != 2) && (musim != 4) && (musim != 6))
                                    while(L.getTanaman(PosPlayer.x, PosPlayer.y - 1).GetAge() != 0)
                                        L.getTanaman(PosPlayer.x, PosPlayer.y - 1).DecAge();
                                break;
                            case 3:
                                if ((musim != 3) && (musim != 4))
                                    while(L.getTanaman(PosPlayer.x, PosPlayer.y - 1).GetAge() != 0)
                                        L.getTanaman(PosPlayer.x, PosPlayer.y - 1).DecAge();
                                break;
                        }
                    }
                }
                else
                {
                    I.DeleteInventory(I.GetKodeBarang(slot), jumlah);
                    cerr << "You just throw your item, it's useless" << endl;
                    Sleep(1000);
                }
                break;
        case 'v' :
                if ((PosPlayer.y < 8) && (cond2 == 2))          // menanam bibit
                {
                    if (I.IsBibit(slot))
                    {
                        L.setStatus(PosPlayer.x, PosPlayer.y + 1, 3);
                        L.setTanaman(PosPlayer.x, PosPlayer.y + 1, I.GetKodeBarang(slot) + 8);
                        I.DeleteInventory(I.GetKodeBarang(slot), jumlah);
                        int musim = L.getTanaman(PosPlayer.x, PosPlayer.y + 1).GetMusimable();
                        switch (T.GetSeason())
                        {
                            case 0:
                                if ((musim != 0) && (musim != 4) && (musim != 5))
                                    while(L.getTanaman(PosPlayer.x, PosPlayer.y + 1).GetAge() != 0)
                                        L.getTanaman(PosPlayer.x, PosPlayer.y + 1).DecAge();
                                break;
                            case 1:
                                if ((musim != 1) && (musim != 4) && (musim != 5) && (musim != 6))
                                    while(L.getTanaman(PosPlayer.x, PosPlayer.y + 1).GetAge() != 0)
                                        L.getTanaman(PosPlayer.x, PosPlayer.y + 1).DecAge();
                                break;
                            case 2:
                                if ((musim != 2) && (musim != 4) && (musim != 6))
                                    while(L.getTanaman(PosPlayer.x, PosPlayer.y + 1).GetAge() != 0)
                                        L.getTanaman(PosPlayer.x, PosPlayer.y + 1).DecAge();
                                break;
                            case 3:
                                if ((musim != 3) && (musim != 4))
                                    while(L.getTanaman(PosPlayer.x, PosPlayer.y + 1).GetAge() != 0)
                                        L.getTanaman(PosPlayer.x, PosPlayer.y + 1).DecAge();
                                break;
                        }
                    }
                }
                else
                {
                    I.DeleteInventory(I.GetKodeBarang(slot), jumlah);
                    cerr << "You just throw your item, it's useless" << endl;
                    Sleep(1000);
                }
                break;
        case '>' :
                if ((PosPlayer.x == 7) && (PosPlayer.y == 0))   // ke arah titik jual
                {
                    if (!I.IsBibit(slot))
                        I.Sell(slot, jumlah);
                    else
                    {
                        cout << "You can't sell seed here!" << endl;
                        Sleep(1000);
                    }
                }
                else
                if ((PosPlayer.x < 8) && (cond3 == 2))          // menanam bibit
                {
                    if (I.IsBibit(slot))
                    {
                        L.setStatus(PosPlayer.x + 1, PosPlayer.y, 3);
                        L.setTanaman(PosPlayer.x + 1, PosPlayer.y, I.GetKodeBarang(slot) + 8);
                        I.DeleteInventory(I.GetKodeBarang(slot), jumlah);
                        int musim = L.getTanaman(PosPlayer.x + 1, PosPlayer.y).GetMusimable();
                        switch (T.GetSeason())
                        {
                            case 0:
                                if ((musim != 0) && (musim != 4) && (musim != 5))
                                    while(L.getTanaman(PosPlayer.x + 1, PosPlayer.y).GetAge() != 0)
                                        L.getTanaman(PosPlayer.x + 1, PosPlayer.y).DecAge();
                                break;
                            case 1:
                                if ((musim != 1) && (musim != 4) && (musim != 5) && (musim != 6))
                                    while(L.getTanaman(PosPlayer.x + 1, PosPlayer.y).GetAge() != 0)
                                        L.getTanaman(PosPlayer.x + 1, PosPlayer.y).DecAge();
                                break;
                            case 2:
                                if ((musim != 2) && (musim != 4) && (musim != 6))
                                    while(L.getTanaman(PosPlayer.x + 1, PosPlayer.y).GetAge() != 0)
                                        L.getTanaman(PosPlayer.x + 1, PosPlayer.y).DecAge();
                                break;
                            case 3:
                                if ((musim != 3) && (musim != 4))
                                    while(L.getTanaman(PosPlayer.x + 1, PosPlayer.y).GetAge() != 0)
                                        L.getTanaman(PosPlayer.x + 1, PosPlayer.y).DecAge();
                                break;
                        }
                    }
                }
                else
                {
                    I.DeleteInventory(I.GetKodeBarang(slot), jumlah);
                    cerr << "You just throw your item, it's useless" << endl;
                    Sleep(1000);
                }
                break;
        case '<' :
                if ((PosPlayer.x > 0) && (cond4 == 2))          // menanam bibit
                {
                    if (I.IsBibit(slot))
                    {
                        L.setStatus(PosPlayer.x - 1, PosPlayer.y, 3);
                        L.setTanaman(PosPlayer.x - 1, PosPlayer.y, I.GetKodeBarang(slot) + 8);
                        I.DeleteInventory(I.GetKodeBarang(slot), jumlah);
                        int musim = L.getTanaman(PosPlayer.x - 1, PosPlayer.y).GetMusimable();
                        switch (T.GetSeason())
                        {
                            case 0:
                                if ((musim != 0) && (musim != 4) && (musim != 5))
                                    while(L.getTanaman(PosPlayer.x - 1, PosPlayer.y).GetAge() != 0)
                                        L.getTanaman(PosPlayer.x - 1, PosPlayer.y).DecAge();
                                break;
                            case 1:
                                if ((musim != 1) && (musim != 4) && (musim != 5) && (musim != 6))
                                    while(L.getTanaman(PosPlayer.x - 1, PosPlayer.y).GetAge() != 0)
                                        L.getTanaman(PosPlayer.x - 1, PosPlayer.y).DecAge();
                                break;
                            case 2:
                                if ((musim != 2) && (musim != 4) && (musim != 6))
                                    while(L.getTanaman(PosPlayer.x - 1, PosPlayer.y).GetAge() != 0)
                                        L.getTanaman(PosPlayer.x - 1, PosPlayer.y).DecAge();
                                break;
                            case 3:
                                if ((musim != 3) && (musim != 4))
                                    while(L.getTanaman(PosPlayer.x - 1, PosPlayer.y).GetAge() != 0)
                                        L.getTanaman(PosPlayer.x - 1, PosPlayer.y).DecAge();
                                break;
                        }
                    }
                }
                else
                {
                    I.DeleteInventory(I.GetKodeBarang(slot), jumlah);
                    cerr << "You just throw your item, it's useless" << endl;
                    Sleep(1000);
                }
                break;
    }
}

void Player::Slash()
{
    int cond1 = L.getStatus(P.GetPosition().x, P.GetPosition().y - 1);  // untuk aksi ke atas
    int cond2 = L.getStatus(P.GetPosition().x, P.GetPosition().y + 1);  // untuk aksi ke bawah
    int cond3 = L.getStatus(P.GetPosition().x + 1, P.GetPosition().y);  // untuk aksi ke kanan
    int cond4 = L.getStatus(P.GetPosition().x - 1, P.GetPosition().y);  // untuk aksi ke kiri

    M.IsSaved = 0;

    switch (FacingTo)
    {
        case '^' :
                if ((PosPlayer.y > 0) && ((cond1 == 5) || (cond1 == 6) || (cond1 == 7) || (cond1 == 8)))
                {
                    L.deleteTanaman(PosPlayer.x, PosPlayer.y - 1);
                    L.setStatus(PosPlayer.x, PosPlayer.y - 1, 1);
                }
                else
                {
                    cerr << "It's useless..." << endl;
                    Sleep(1000);
                }
                break;
        case 'v' :
                if ((PosPlayer.y < 8) && ((cond2 == 5) || (cond2 == 6) || (cond2 == 7) || (cond2 == 8)))
                {
                    L.deleteTanaman(PosPlayer.x, PosPlayer.y + 1);
                    L.setStatus(PosPlayer.x, PosPlayer.y + 1, 1);
                }
                else
                {
                    cerr << "It's useless..." << endl;
                    Sleep(1000);
                }
                break;
        case '>' :
                if ((PosPlayer.x < 8) && ((cond3 == 5) || (cond3 == 6) || (cond3 == 7) || (cond3 == 8)))
                {
                    L.deleteTanaman(PosPlayer.x + 1, PosPlayer.y);
                    L.setStatus(PosPlayer.x + 1, PosPlayer.y, 1);
                }
                else
                {
                    cerr << "It's useless..." << endl;
                    Sleep(1000);
                }
                break;
        case '<' :
                if ((PosPlayer.x > 0) && ((cond4 == 5) || (cond4 == 6) || (cond4 == 7) || (cond4 == 8)))
                {
                    L.deleteTanaman(PosPlayer.x - 1, PosPlayer.y);
                    L.setStatus(PosPlayer.x - 1, PosPlayer.y, 1);
                }
                else
                {
                    cerr << "It's useless..." << endl;
                    Sleep(1000);
                }
                break;
    }
}

void Player::Water()
{
    int cond1 = L.getStatus(P.GetPosition().x, P.GetPosition().y - 1);  // untuk aksi ke atas
    int cond2 = L.getStatus(P.GetPosition().x, P.GetPosition().y + 1);  // untuk aksi ke bawah
    int cond3 = L.getStatus(P.GetPosition().x + 1, P.GetPosition().y);  // untuk aksi ke kanan
    int cond4 = L.getStatus(P.GetPosition().x - 1, P.GetPosition().y);  // untuk aksi ke kiri

    M.IsSaved = 0;

    switch (FacingTo)
    {
        case '^' :
                if (PosPlayer.y > 0)
                {
                    if (cond1 == 3)
                    {
                        L.setStatus(PosPlayer.x, PosPlayer.y - 1, 4);
                    }
                    else if (cond1 == 5)
                    {
                        L.setStatus(PosPlayer.x, PosPlayer.y - 1, 6);
                    }
                    else
                    {
                        cerr << "It's useless.." << endl;
                        Sleep(1000);
                    }
                }
                else
                {
                    cerr << "Where you will be watering?" << endl;
                    Sleep(1000);
                }
                break;
        case 'v' :
                if (PosPlayer.y < 8)
                {
                    if (cond2 == 3)
                    {
                        L.setStatus(PosPlayer.x, PosPlayer.y + 1, 4);
                    }
                    else if (cond2 == 5)
                    {
                        L.setStatus(PosPlayer.x, PosPlayer.y + 1, 6);
                    }
                    else
                    {
                        cerr << "It's useless.." << endl;
                        Sleep(1000);
                    }
                }
                else
                {
                    cerr << "Where you will be watering?" << endl;
                    Sleep(1000);
                }
                break;
        case '>' :
                if (PosPlayer.x < 8)
                {
                    if (cond3 == 3)
                    {
                        L.setStatus(PosPlayer.x + 1, PosPlayer.y, 4);
                    }
                    else if (cond3 == 5)
                    {
                        L.setStatus(PosPlayer.x + 1, PosPlayer.y, 6);
                    }
                    else
                    {
                        cerr << "It's useless.." << endl;
                        Sleep(1000);
                    }
                }
                else
                {
                    cerr << "Where you will be watering?" << endl;
                    Sleep(1000);
                }
                break;
        case '<' :
                if (PosPlayer.x > 0)
                {
                    if (cond4 == 3)
                    {
                        L.setStatus(PosPlayer.x - 1, PosPlayer.y, 4);
                    }
                    else if (cond4 == 5)
                    {
                        L.setStatus(PosPlayer.x - 1, PosPlayer.y, 6);
                    }
                    else
                    {
                        cerr << "It's useless.." << endl;
                        Sleep(1000);
                    }
                }
                else
                {
                    cerr << "Where you will be watering?" << endl;
                    Sleep(1000);
                }
                break;
    }
}

void Player::Harvest()
{
    int cond1 = L.getStatus(P.GetPosition().x, P.GetPosition().y - 1);  // untuk aksi ke atas
    int cond2 = L.getStatus(P.GetPosition().x, P.GetPosition().y + 1);  // untuk aksi ke bawah
    int cond3 = L.getStatus(P.GetPosition().x + 1, P.GetPosition().y);  // untuk aksi ke kanan
    int cond4 = L.getStatus(P.GetPosition().x - 1, P.GetPosition().y);  // untuk aksi ke kiri

    M.IsSaved = 0;

    switch (FacingTo)
    {
        case '^' :
                if ((PosPlayer.y > 0) && (cond1 == 7))
                {
                    L.getTanaman(PosPlayer.x, PosPlayer.y - 1).Harvested();
                    I.InsertInventory(L.getTanaman(PosPlayer.x, PosPlayer.y - 1).GetKodeTanaman(), 1);
                }
                else
                {
                    cerr << "Can't harvest here!" << endl;
                    Sleep(1000);
                }
                break;
        case 'v' :
                if ((PosPlayer.y < 8) && (cond2 == 7))
                {
                    L.getTanaman(PosPlayer.x, PosPlayer.y + 1).Harvested();
                    I.InsertInventory(L.getTanaman(PosPlayer.x, PosPlayer.y + 1).GetKodeTanaman(), 1);
                }
                else
                {
                    cerr << "Can't harvest here!" << endl;
                    Sleep(1000);
                }
                break;
        case '>' :
                if ((PosPlayer.x < 8) && (cond3 == 7))
                {
                    L.getTanaman(PosPlayer.x + 1, PosPlayer.y).Harvested();
                    I.InsertInventory(L.getTanaman(PosPlayer.x + 1, PosPlayer.y).GetKodeTanaman(), 1);
                }
                else
                {
                    cerr << "Can't harvest here!" << endl;
                    Sleep(1000);
                }
                break;
        case '<' :
                if ((PosPlayer.x > 0) && (cond4 == 7))
                {
                    L.getTanaman(PosPlayer.x - 1, PosPlayer.y).Harvested();
                    I.InsertInventory(L.getTanaman(PosPlayer.x - 1, PosPlayer.y).GetKodeTanaman(), 1);
                }
                else
                {
                    cerr << "Can't harvest here!" << endl;
                    Sleep(1000);
                }
                break;
    }
}

void Player::Eat(int slot)
{
    M.IsSaved = 0;

    if (!I.IsBibit(slot))
    {
        if (I.GetKodeBarang(slot) == 9)
        {
            ChronoPlant::EatEffect();
            Sleep(1000);
        }
        else if (I.GetKodeBarang(slot) == 10)
        {
            ReynFruit::EatEffect();
            Sleep(1000);
        }
        else if (I.GetKodeBarang(slot) == 11)
        {
            Ichalmond::EatEffect();
            Sleep(1000);
        }
        else if (I.GetKodeBarang(slot) == 12)
        {
            Edondong::EatEffect();
            Sleep(1000);
        }
        else if (I.GetKodeBarang(slot) == 13)
        {
            GreenAlgoe::EatEffect();
            Sleep(1000);
        }
        else if (I.GetKodeBarang(slot) == 14)
        {
            PlaySound(TEXT("music/Smash.wav"), NULL, SND_FILENAME | SND_ASYNC | SND_LOOP);
            Hanselnut::EatEffect();
            Sleep(1000);
        }
        else if (I.GetKodeBarang(slot) == 15)
        {
            AbelTree::EatEffect();
            Sleep(1000);
        }
        else if (I.GetKodeBarang(slot) == 16)
        {
            Elmonade::EatEffect();
            Sleep(1000);
        }
        else // (I.GetKodeBarang(slot) == 0)
        {
            cerr << "There's nothing in this slot..." << endl;
            Sleep(1000);
        }
        I.DeleteInventory(I.GetKodeBarang(slot), 1);
    }
    else
    {
        cerr << "You can't eat seed!" << endl;
        Sleep(1000);
    }
}

Position Player::GetPosition() const
{
    return(PosPlayer);
}

void Player::SetPosition(int x, int y)
{
    PosPlayer.x = x;
    PosPlayer.y = y;
}
char Player::GetFace() const
{
    return(FacingTo);
}

int Player::GetPlace() const
{
    return(Place);
}
